#include "CloneTest.h"

Person::Person()
{
	this->type = PersonType::per;
}
Person::Person(const Person& src):type(src.type),
name(src.name),
age(src.age)
{
}
Person::~Person()
{
}
Person& Person::Clone(const Person& oriPer)
{
	if (oriPer.type == PersonType::tea)
	{
		Teacher ori = *(Teacher*)&oriPer;
		Teacher newP = Teacher(ori);
		return newP;
	}
	else
	{
		Person newP = Person(oriPer);
		return newP;
	}
}

Teacher::Teacher()
{
	this->type = PersonType::tea;
}
Teacher::Teacher(const Teacher& src):Person(src),
school(src.school)
{
}
Teacher::~Teacher()
{
}
School::School()
{
	this->teacherList = new vector<Teacher>();
}